<?php
if (!defined('SERVER_ROOT')) {exit('No direct script access allowed');}
$this->template->title = 'Quá trình công tác của cán bộ';
$v_pop_win = isset($_REQUEST['pop_win']) ? '_pop_win' : '';
$this->template->display('dsp_header' . $v_pop_win . '.php');
$MA_CAN_BO = '';
$TEN_CAN_BO = '';
while ($arr = $arr_single_canbo->FetchRow()) {
    $MA_CAN_BO = $arr['MA_CAN_BO'];
    $TEN_CAN_BO = $arr['TEN_CAN_BO'];
}
?>
<form name="frmMain" method="post" id="frmMain" action=""><?php
    echo $this->hidden('controller', $this->get_controller_url());
    echo $this->hidden('hdn_dsp_single_method', 'dsp_single_to');
    echo $this->hidden('hdn_dsp_all_method', 'dsp_phan_to');
    echo $this->hidden('hdn_update_method', 'update_phanto');
    echo $this->hidden('hdn_delete_method', 'delete_phanto');
    echo $this->hidden('hdn_item_id', $MA_CAN_BO);
    echo $this->hidden('hdn_item_id_canbo', $MA_CAN_BO);
    echo $this->hidden('hdn_item_id_to', '0');
    echo $this->hidden('hdn_item_id_chucvu', '0');
    echo $this->hidden('hdn_item_id_tungay', '0');
    echo $this->hidden('pop_win', $v_pop_win);
    $v_row = 0;
    ?>
    <h4 style="text-align: center">Quá trình công tác của <?php echo $TEN_CAN_BO; ?></h4>
    <div>
        <table width="100%" class="adminlist" cellspacing="0" border="1">
            <colgroup>
                <col width="25%" />
                <col width="25%" />
                <col width="25%" />
                <col width="13%" />
                <col width="12%" />
            </colgroup>
            <tr>
                <th>Tổ/bộ môn</th>
                <th>Đơn vị</th>
                <th>Chức vụ</th>
                <th>Từ ngày</th>
                <th>Đến ngày</th>
            </tr>
            <?php while ($arr = $arr_all_to_of_canbo->FetchRow()): ?>
              <?php $TEN_DON_VI = $arr['TEN_DON_VI'];
                    $MA_TO = $arr['MA_TO_CHUYEN_MON'];
                    $TEN_TO = $arr['TEN_TO_CHUYEN_MON'];
                    $TEN_CHUC_VU = $arr['TEN_CHUC_VU'];
                    $TU_NGAY = $arr['TU_NGAY'];
                    $DEN_NGAY = $arr['DEN_NGAY'];
                    $KIEM_NHIEM = $arr['KIEM_NHIEM'];
                    $MA_CHUC_VU = $arr['MA_CHUC_VU'];
                    $v_class = 'row' . ($v_row % 2);
                    $v_row++;
                ?>
                <tr class="<?php echo $v_class; ?>">
                    <td><?php echo $TEN_TO; ?></td>
                    <td><?php echo $TEN_DON_VI; ?></td>
                    <td><?php echo $TEN_CHUC_VU; if($KIEM_NHIEM==1){echo ' (kiêm nhiệm)';}?> </td>
                    <td><?php echo $TU_NGAY; ?></td>
                    <td><?php echo $DEN_NGAY; ?></td>
                </tr>
            <?php endwhile; ?>
        </table>
    </div>
</div>

</div>

</form>
<script>
      function themnoicongtac_onclick(macanbo) {
          var url = '<?php echo $this->get_controller_url(); ?>dsp_themnoicongtac/' + macanbo
          url += '/?&macanbo=' + macanbo + '&pop_win=1';
          showPopWin(url, 450, 220, null);
      }
      function capnhatcongtac_onclick(mato, macanbo, machucvu, tungay){
           var url = '<?php echo $this->get_controller_url(); ?>dsp_capnhatcongtac/' + macanbo
          url += '/?&mato=' + mato ;
          url += '&macanbo=' + macanbo;
          url += '&machucvu=' + machucvu;
          url += '&tungay=' + tungay + '&pop_win=1';
          showPopWin(url, 400, 280, null);
      }

</script>
<?php
$this->template->display('dsp_footer' . $v_pop_win . '.php');